<?php

date_default_timezone_set('PRC');

define("CALI_PATH",dirname(dirname(__FILE__)));
define("SP_PATH",CALI_PATH . DIRECTORY_SEPARATOR ."SpeedPHP");
define("APP_PATH",dirname(__FILE__));

define("LIBRARY_PATH" , CALI_PATH . DIRECTORY_SEPARATOR . "library");
define("LOG_PATH" , CALI_PATH . DIRECTORY_SEPARATOR ."log");


set_include_path(get_include_path() . PATH_SEPARATOR . LIBRARY_PATH );

include_once  'Monolog/Logger.php';
include_once  'Monolog/Handler/HandlerInterface.php';
include_once  'Monolog/Handler/AbstractHandler.php';
include_once 'Monolog/Handler/AbstractProcessingHandler.php';
include_once  'Monolog/Handler/StreamHandler.php';
include_once  'Monolog/Formatter/FormatterInterface.php';
include_once  'Monolog/Formatter/NormalizerFormatter.php';
include_once  'Monolog/Formatter/LineFormatter.php';
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('root');
$logger->pushHandler(new StreamHandler(LOG_PATH . '/' . date( 'Y-m-d' ) .'.log', Logger::DEBUG));



define("TPL_PATH",APP_PATH.'/../tpl/');
define("CACHE_TIME", 86400);

$spConfig = array(
    'controller_path' => APP_PATH.'/../controller',
    'model_path' => APP_PATH.'/../model',
    'sp_cache' => APP_PATH.'/../cache', // 框架临时文件夹目录
    'view' => array( // 视图配置
        'enabled' => TRUE, // 开启视图
        'config' =>array(
                'template_dir' => CALI_PATH . DIRECTORY_SEPARATOR.'tpl', // 模板目录
        ),
        'engine_name' => 'speedy', // 模板引擎的类名称
        'engine_path' => SP_PATH.'/Drivers/speedy.php', // 模板引擎主类路径
    ),
    'db' => array(  // 数据库连接配置
        'driver' => 'mysql',   // 驱动类型
	'host' => '127.0.0.1', // 数据库地址
        //'host' => '127.0.0.1',
	'port' => 3306,        // 端口
        'login' => 'root',     // 用户名
        //'login' => 'root',
	//'password' => 'ns2b7',      // 密码
	'password' => 'soidofidf239cv',
        //'password' => '',  
        'database' => 'pof_data',      // 库名称
	'prefix' => '',           // 表前缀
	'persistent' => FALSE,    // 是否使用长链接
    ),
    'url' => array(
                'url_path_info' => false, // 是否使用path_info方式的URL
                'url_path_base' => '/', // URL的根目录访问地址
        ),
    'ext' => array(
        'logger' => $logger,
        'main400' => '4000718899',
        'spVerifyCode' => array( //验证码扩展
            'width' => 60, //验证码宽度
            'height' => 20, //验证码高度
            'length' => 4, //验证码字符长度
            'bgcolor' => '#FFFFFF', //背景色
            'noisenum' => 50, //图像噪点数量
            'fontsize' => 22, //字体大小
            'fontfile' => 'font.ttf', //字体文件
            'format' => 'gif', //验证码输出图片格式
        ),
        'spIDInfo' => array(
            'key' => 'dfsdfff',
        )
        )
);

require(SP_PATH."/SpeedPHP.php");
spRun(); // SpeedPHP 3新特性
